package com.heer.gymnasium.module.fellow.beans;

import com.heer.gymnasium.base.BaseBean;
import com.heer.gymnasium.base.ListBaseBean;
import com.heer.gymnasium.module.evaluate.beans.MemberListResponseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yan
 * on 2018/3/22
 */

public class FellowMemberBean extends BaseBean {
    private String id;
    private String username;
    private String nickname;
    private String avatar;
    private boolean is_eval;
    private boolean is_start;
    private List<String> tag_me;
    private List<String> tag_other;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public boolean is_eval() {
        return is_eval;
    }

    public void setIs_eval(boolean is_eval) {
        this.is_eval = is_eval;
    }

    public boolean is_start() {
        return is_start;
    }

    public void setIs_start(boolean is_start) {
        this.is_start = is_start;
    }

    public List<String> getTag_me() {
        return tag_me;
    }

    public void setTag_me(List<String> tag_me) {
        this.tag_me = tag_me;
    }

    public List<String> getTag_other() {
        return tag_other;
    }

    public void setTag_other(List<String> tag_other) {
        this.tag_other = tag_other;
    }


    public static List<FellowMemberBean> dataChange(List<MemberListResponseBean.Item> data) {
        List<FellowMemberBean> beanList = new ArrayList<>();
        if (data != null && data.size() != 0) {
            for (MemberListResponseBean.Item item : data) {
                FellowMemberBean bean = new FellowMemberBean();
                bean.setId(item.getId() + "");
                bean.setUsername(item.getUsername());
                bean.setNickname(item.getNickname());
                bean.setAvatar(item.getAvatar());
                if (item.getIs_eval().equals("1")) {
                    bean.setIs_eval(true);
                } else {
                    bean.setIs_eval(false);
                }
                if (item.getIs_start() .equals("1")) {
                    bean.setIs_start(true);
                } else {
                    bean.setIs_eval(false);
                }
                bean.setTag_me(item.getTag().getTag_me());
                bean.setTag_other(item.getTag().getTag_other());
                beanList.add(bean);
            }
        }
        return beanList;

    }

}
